/*
Copyright Polyakov Mark (qshadowp) 2012.
GNU GPLv3
*/
 package system.apps;
 
 import system.staros.cblock1.*;
 import java.lang.*;
 import java.io.*;
  public class pi extends Task {
 	
 

 	public void run () {
		println ("You can't run <pi> in the background");
 	}
 	
 	public int main ( String args[] ) {
		File pti=null;
 		
 		if ( args.length == 1 ) {
 		        try {
	 			pti=new File("system/"+args[0]);
	 		} catch (Exception exception) {
	 			println("Can't install package");
	 			return 0;
	 		}
			if (pti.exists()){
			println("Installing...");
			system.util.UnzipUtil.unzip(new File("system/"+args[0]),new File("system/"));
			} else {
			println("Specified package does not exist. Use as ''pi downloads/foo.pck''");
			}
 		} else
 			println ("USAGE: pi <package>");
 		return 0;
 	}
 	
 }